home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / qbtools1.arc / AECOLINS.BAS < prev    next >
BASIC Source File  |  1987-12-10  |  6KB  |  189 lines

  1. rem $linesize:132
  2. rem $title:'Color installation procedure for Application Engineer'
  3. rem $subtitle:'Initialization'
  4. '
  5. '  Initialise standard file (APPCOLOR.CTL)
  6. '  with color selection parameters. Previous colors should be displayed.
  7. '  Show 8 Items up top of screen with foreground/background/highlight
  8. '  words (and blocks).
  9. '
  10. rem $include:'aeshared.bas'
  11.  
  12.  
  13.     sub aecolins static                            ' Color Installation
  14.  
  15.  
  16.         redim sutxt$(8%)                               ' Sub Routine Descriptions
  17.         call color.init("APPCOLOR.CTL")              ' Get initial params
  18.  
  19.         data "Pull Down Menus"
  20.         data "Dialogue Boxes"
  21.         data "Error Messages"
  22.         data "Select from List"
  23.         data "Yes or No"
  24.         data "Press Any Key"
  25.         data "Help Text"
  26.         data ""
  27.         x.co%=1%                                  ' Currently selected item
  28.         y.co%=1%                                  ' Currently selected item
  29.         darr$=chr$(31%)                           ' Down arrow
  30.         rarr$=chr$(16%)                           ' Right arrow
  31.         restore
  32.         for j%=1% to 8%
  33.             read sutxt$(j%)
  34.         next j%
  35.         cls
  36.         call centre.text("Color Preferences",1%)
  37.         call aecolscr
  38.         call centre.text("Use "+darr$+","+rarr$+" to select item, space bar to cycle color, RETURN to save",22%)
  39.  
  40.         for j%=1% to 8%
  41.             for k%=1% to 3%
  42.                 if k%=1% then
  43.                     x%=5%
  44.                     attr%=(ae.bg%(j%) and 7%) * 16% + ae.fg%(j%)
  45.                 elseif k%=2% then
  46.                     attr%=(ae.bg%(j%) and 7%) * 16% + ae.fg%(j%)
  47.                     x%=30%
  48.                 else
  49.                     attr%=(ae.fg%(j%) and 7%) * 16% + ae.hg%(j%)
  50.                     x%=56%
  51.                 end if
  52.                 call xqprint(sutxt$(j%),4%+(j%*2%),x%,attr%,0%)
  53.             next k%
  54.         next j%
  55.  
  56.  
  57.         dsp$=string$(4%,219%)
  58.         for j%=0% to 15%
  59.             attr%=(0% and 7%) * 16% + j%
  60.             call xqprint(dsp$,24%,j%*5%+1%,attr%,0%)
  61.         next j%
  62.  
  63.         cycle%=0%
  64.         while cycle%=0%
  65.             locate 2,1
  66.             call clreol
  67.             if x.co%=1% then
  68.                 call qprint(darr$,2%,15%)
  69.                 po%=ae.fg%(y.co%)
  70.             elseif x.co%=2% then
  71.                 call qprint(darr$,2%,41%)
  72.                 po%=ae.bg%(y.co%)
  73.             elseif x.co%=3% then
  74.                 call qprint(darr$,2%,66%)
  75.                 po%=ae.hg%(y.co%)
  76.             end if
  77.  
  78.             for k%=1% to 3%
  79.                 if k%=1% then
  80.                     x%=5%
  81.                     attr%=(ae.bg%(y.co%) and 7%) * 16% + ae.fg%(y.co%)
  82.                 elseif k%=2% then
  83.                     attr%=(ae.bg%(y.co%) and 7%) * 16% + ae.fg%(y.co%)
  84.                     x%=30%
  85.                 elseif k%=3% then
  86.                     attr%=(ae.fg%(y.co%) and 7%) * 16% + ae.hg%(y.co%)
  87.                     x%=56%
  88.                 end if
  89.                 call xqprint(sutxt$(y.co%),4%+(y.co%*2%),x%,attr%,0%)
  90.             next k%
  91.  
  92.             for j%=1% to 8%
  93.                 call qprint(" ",4%+j%*2%,1%)
  94.             next j%
  95.             call qprint(rarr$,4%+y.co%*2%,1%)
  96.  
  97.             locate 23,1
  98.             call clreol
  99.             call qprint(darr$,23%,po%*5%+2%)
  100.             call get.single(ccode%,ctype%)
  101.  
  102.             if ctype%=1%  then                     ' Normal character
  103.                 if ccode%=32% then                  ' Move to next color
  104.  
  105.                     if po%<15% then
  106.                         po%=po%+1%
  107.                     else
  108.                         po%=0%
  109.                     end if
  110.  
  111.                     if x.co%=1% then
  112.                         ae.fg%(y.co%)=po%
  113.                     end if
  114.                     if x.co%=2% then
  115.                         ae.bg%(y.co%)=po%
  116.                     end if
  117.                     if x.co%=3% then
  118.                         ae.hg%(y.co%)=po%
  119.                     end if
  120.                 end if
  121.                 if ccode%=13% then                  ' End of colins?
  122.                     cycle%=1%
  123.                 end if
  124.             end if
  125.  
  126.             if ctype%=2% then                      ' For arrows
  127.                 if ccode%=75% then                  ' Left arrow
  128.                     x.co%=x.co%-1%
  129.                 end if
  130.                 if ccode%=77% then                  ' Right arrow
  131.                     x.co%=x.co%+1%
  132.                 end if
  133.                 if ccode%=72% then                  ' Up arrow
  134.                     y.co%=y.co%-1%
  135.                 end if
  136.                 if ccode%=80% then                  ' Down arrow
  137.                     y.co%=y.co%+1%
  138.                 end if
  139.             end if
  140.  
  141.             if x.co%>3% then
  142.                 x.co%=1%
  143.             end if
  144.  
  145.             if y.co%>8% then
  146.                 y.co%=1%
  147.             end if
  148.             if x.co%<1% then
  149.                 x.co%=3%
  150.             end if
  151.             if y.co%<1% then
  152.                 y.co%=8%
  153.             end if
  154.         wend
  155.  
  156.         open "r",1,"appcolor.ctl,60
  157.         field #1,60 as aa$
  158.         bb$=""
  159.         for j%=1% to 10%
  160.             bb$=bb$+chr$(ae.fg%(j%))+chr$(ae.bg%(j%))+chr$(ae.hg%(j%))
  161.         next j%
  162.         lset aa$=bb$
  163.         put #1,1
  164.         close 1
  165.  
  166.     end sub
  167.  
  168.   sub aecolscr static
  169.        call qprint("┌───────────────────────────────────────────────────────────────────────────┐",3,3)
  170.        call qprint("│  Fore Ground Color          Back Ground Color        High Light Color     │",4,3)
  171.        call qprint("╞════════════════════════╤═════════════════════════╤════════════════════════╡",5,3)
  172.        call qprint("│                        │                         │                        │",6,3)
  173.        call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",7,3)
  174.        call qprint("│                        │                         │                        │",8,3)
  175.        call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",9,3)
  176.        call qprint("│                        │                         │                        │",10,3)
  177.        call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",11,3)
  178.        call qprint("│                        │                         │                        │",12,3)
  179.        call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",13,3)
  180.        call qprint("│                        │                         │                        │",14,3)
  181.        call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",15,3)
  182.        call qprint("│                        │                         │                        │",16,3)
  183.        call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",17,3)
  184.        call qprint("│                        │                         │                        │",18,3)
  185.        call qprint("├────────────────────────┼─────────────────────────┼────────────────────────┤",19,3)
  186.        call qprint("│                        │                         │                        │",20,3)
  187.        call qprint("└────────────────────────┴─────────────────────────┴────────────────────────┘",21,3)
  188.   end sub ' aecolscr
  189.